package com.example.homework1.control;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

@RestController
public class hello {
    @GetMapping("/hello")
    public  String say(){
        return "helloworld";
    }
    @GetMapping("/random")
    public int ran(){
        Random random = new Random();
        return random.nextInt(1000);
    }
    @GetMapping("/squ/{number}")
    public int squ(@PathVariable int number){
        return number*number;
    }
}
